package com.texplose.mapper;

import com.texplose.entity.Recipe;
import com.texplose.entity.vo.*;
import org.apache.ibatis.annotations.Param;

import java.util.List;

/**
 * @author : lyj
 * @Timer : 2022/5/18
 * @Description :
 */
public interface RecipeMapper {
    List<IndexCardsVo> getIndexCards();

    List<IndexCardsVo> getIndexCardsByLikes();

    List<IndexCardsVo> getIndexCardsByCreate();

    List<SwiperVo> getSwiper();

    List<UserWorksVo> getWorksByUserId(@Param("userId") int userId);

    List<Recipe> getRecipeListByCategoryId(@Param("id") Integer id);

    List<UserCollectionVo> getCollectionsByUserId(@Param("id") Integer id);

    void deleteRecipeById(Integer id);

    RecipeDetailVo getRecipeDetailById(@Param("id") Integer id);

    List<IndexCardsVo> searchRecipeByTitle(@Param("title") String title);

    List<Recipe> selectList();

    void updateViewById(@Param("id") int id, @Param("views") int views);

    void addRecipe(@Param("addRecipeVo") AddRecipeVo addRecipeVo);

    Integer countByUserId(Integer id);
}
